#include "Poller.h"
#include "EPollPoller.h"
#include <sys/epoll.h>

Poller::Poller(EventLoop *loop)
: _ownerLoop(loop) {}

Poller::~Poller() = default;

bool Poller::hasChannel(Channel* channel) const
{
    ChannelMapConIt it = _channels.find(channel->fd());
    return it !=_channels.end() && it->second == channel;
}


Poller* Poller::newDefaultPoller(EventLoop* loop)
{
    return new EPollPoller(loop);
}
